package com.luoran.bartalks.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;

import com.luoran.bartalks.action.vo.UserMenuVo;
import com.luoran.bartalks.entity.BaseInfo;
import com.luoran.bartalks.entity.biz.BtRoleMenu;
import com.luoran.bartalks.entity.biz.BtUserMenu;
import com.luoran.bartalks.entity.biz.MenuInfo;
import com.luoran.bartalks.entity.biz.UserInfo;

public interface IUserService {
	public UserInfo getUser(String id);

	public UserInfo getUser(String number, String pwd);

	/**
	 * 是否是有效的原始密码
	 * 
	 * @param number
	 * @param pwd
	 * @return
	 */
	public boolean pwdSuccess(String number, String pwd);

	/**
	 * 修改用户密码
	 * 
	 * @param number
	 * @param newPwd
	 */
	public void modifyPwd(String number, String newPwd);

	public UserInfo getInfoByNumber(String number);

	//获取用户菜单!
	public List<UserMenuVo> getUserMenus(String userId);

	//分页
	public PageQuery<? extends BaseInfo> getQueryList(PageQuery<? extends BaseInfo> pageQuery);

	//根据主键id 查询用户信息
	public UserInfo getUserInfo(String id);

	//增加用户
	public String addUser(UserInfo info);

	//更新
	public int editUserInfo(UserInfo info);

	//更新状态 逻辑删除
	public int updateStatus(UserInfo info);

	//获取菜单树
	public List<MenuInfo> getMenuTree();

	//添加用户菜单并生效
	public String addMenuForUser(BtUserMenu userMenu);
	//获取用户生效菜单
	public List<BtUserMenu> getUserMenu(String userId);
	//把用户原有的菜单都删除
	public void deleteUserMenus(String userId);

	//校验用户名是否被占用
	public UserInfo checkUserName(String loginNo);
	//校验邮箱是否被占用
	public UserInfo checkEmail(String email);

	public List<BtRoleMenu> getMenuByRole(String role);
	
	//根据当前登录账号查询公司成员
	public List<UserInfo> getProjectMembers(String companyId);
}
